/* Modal Dialogs */

%theme_dialogs {
  background-color: $dialog_bg_color;
  border-radius: $modal_radius + $base_padding;
  border: solid rgba(black, 0.75);
  border-width: if($variant=='light', 0, 1px);
  box-shadow: 0 3px 6px 0 rgba(black, if($variant=='light', 0.25, 0.35));
}

%last_dialog_button {
  color: white !important;
  background-color: $primary_color;
  background-gradient-direction: none !important;

  &:hover {
    color: white !important;
    background-gradient-direction: none !important;
    @if $shell_version == 'old' {
      background-color: lighten($primary_color, 9%);
    } @else {
      background-color: st-lighten($primary_color, 9%);
    }
  }

  &:active {
    color: white !important;
    background-gradient-direction: none !important;
    @if $shell_version == 'old' {
      background-color: darken($primary_color, 5%);
    } @else {
      background-color: st-darken($primary_color, 5%);
    }
  }

  &:insensitive {
    background-gradient-direction: none !important;
    @if $shell_version == 'old' {
      background-color: transparentize($primary_color, 0.9);
      color: transparentize($primary_color, 0.65) !important;
    } @else {
      background-color: st-transparentize($primary_color, 0.9);
      color: st-transparentize($primary_color, 0.65) !important;
    }
  }
}

// modal dialog
.modal-dialog {
  color: $fg_color;
  padding: $base_padding * 3;
  @extend %theme_dialogs;

  .modal-dialog-content-box {
    padding: 16px 32px 6px;
    spacing: $base_padding * 3;
    max-width: 28em;
  }

  .modal-dialog-button-box {
    padding-top: $base_padding;
    spacing: $base_padding;
  }

  .modal-dialog-button,
  .modal-dialog-linked-button {
    min-height: 40px;
    padding: 0 16px;
    margin: 0;
    border: none !important;
    border-radius: $modal_radius - $base_padding * 2;
    font-weight: bold;

    @include button(normal);
    &:hover { @include button(hover); }
    &:active { @include button(active); }
    &:checked { @include button(checked); }
    &:insensitive { @include button(insensitive); }
    &:focus { @include button(focus); }

    &:last-child {
      @extend %last_dialog_button;
    }
  }
}

// End Session Dialog
.end-session-dialog {
  width: 28em;
  // border: none;

  .end-session-dialog-battery-warning,
  .dialog-list-title {
    color: $warning_color;
  }
}

// Message Dialog
.message-dialog-content {
  spacing: 18px;

  .message-dialog-title {
    text-align: center;
    @extend %title_2;

    &.lightweight {
      @extend %title_4;
    }
  }

  .message-dialog-description { text-align: center; }
}

// Dialog List
.dialog-list {
  spacing: 18px;

  .dialog-list-title {
    text-align: center;
    @extend %heading;
  }

  .dialog-list-scrollview { max-height: 200px; }
  .dialog-list-box {
    spacing: 1em;

    .dialog-list-item {
      spacing: 1em;

      .dialog-list-item-title { font-weight: bold; }
      .dialog-list-item-description {
        color: $alt_fg_color;
        @extend %caption;
      }
    }
  }
}

// Run Dialog
.run-dialog {
  width: 24em;

  .run-dialog-entry {
    padding: $base_padding * 2 $base_padding * 1.5;
  }

  .run-dialog-description {
    text-align: center;
    color: $alt_fg_color;
    @extend %caption;
  }
}

// Password or Authentication Dialog
.prompt-dialog {
  //this is the width of the entire modal popup
  width: 24em;
  // border: none;
}

.prompt-dialog-password-grid {
  spacing-rows: 8px;
  spacing-columns: 4px;

  .prompt-dialog-password-entry {
    width: auto;

    // 4px (spacing) + 16px (spinner-width)
    &:ltr { margin-left: 20px; }
    &:rtl { margin-right: 20px; }
  }
}

.prompt-dialog-password-layout {
  spacing: 8px;
}

.prompt-dialog-password-entry {
  width: 20em;
  padding: $base_padding * 2 $base_padding * 1.5;
}

.prompt-dialog-error-label,
.prompt-dialog-info-label,
.prompt-dialog-null-label {
  text-align: center;
  @extend %caption;
}

.prompt-dialog-error-label {
  color: $error_color;
}

.prompt-dialog-info-label,
.prompt-dialog-null-label {
  color: $hint_fg_color;
}

// Polkit Dialog
.polkit-dialog-user-layout {
  text-align: center;
  spacing: 8px;
  margin-bottom: 6px;

  .polkit-dialog-user-label,
  .polkit-dialog-user-root-label {
    @extend %title_4;
  }

  .polkit-dialog-user-root-label {
    color: $warning_color;
  }
}

// Audio selection dialog
.audio-device-selection-dialog {
  .modal-dialog-content-box { margin-bottom: 28px; }
  .audio-selection-box { spacing: 20px; }
}

.audio-selection-device {
  min-width: 24em;
  border: 1px solid $borders_color;
  border-radius: $bt_radius;

  &:hover, &:focus { background-color: $visit_color; }
  &:active {
    background-color: $selected_bg_color;
    color: $selected_fg_color;
  }
}

.audio-selection-device-box {
  padding: $base_padding * 2;
  spacing: $base_padding * 2;
}

.audio-selection-device-icon {
  icon-size: $base_icon_size * 4;
}

// Welcome dialog
.welcome-dialog-image {
  background-image: url("resource:///org/gnome/shell/theme/gnome-shell-start.svg");
  background-size: contain;
  height: 300px;
  width: 300px;
}

/* Access portal dialog */
.access-dialog {
  text-align: center;
}

// specific label style for restart message
.restart-message {
  @extend %title_4;
}
